import { execSync as exec } from "child_process";

export function exrpd(arg: string, homeDir = "", dockerImage = "peersyst/xrp-evm-client:latest"): string {
    return exec(`docker run --rm -v ${homeDir}:/root/.exrpd ${dockerImage} exrpd ${arg}`, {
        encoding: "utf8",
        stdio: "pipe",
    });
}

export function formatAmount(amount: number, denom: string, decimals = 0): string {
    return `${amount}${"0".repeat(decimals)}${denom}`;
}
